# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidEnterprise.V1.Model.AppRestrictionsSchemaRestrictionRestrictionValue do
  @moduledoc """
  A typed value for the restriction.

  ## Attributes

  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the value being provided.
  *   `valueBool` (*type:* `boolean()`, *default:* `nil`) - The boolean value - this will only be present if type is bool.
  *   `valueInteger` (*type:* `integer()`, *default:* `nil`) - The integer value - this will only be present if type is integer.
  *   `valueMultiselect` (*type:* `list(String.t)`, *default:* `nil`) - The list of string values - this will only be present if type is multiselect.
  *   `valueString` (*type:* `String.t`, *default:* `nil`) - The string value - this will be present for types string, choice and hidden.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :type => String.t() | nil,
          :valueBool => boolean() | nil,
          :valueInteger => integer() | nil,
          :valueMultiselect => list(String.t()) | nil,
          :valueString => String.t() | nil
        }

  field(:type)
  field(:valueBool)
  field(:valueInteger)
  field(:valueMultiselect, type: :list)
  field(:valueString)
end

defimpl Poison.Decoder,
  for: GoogleApi.AndroidEnterprise.V1.Model.AppRestrictionsSchemaRestrictionRestrictionValue do
  def decode(value, options) do
    GoogleApi.AndroidEnterprise.V1.Model.AppRestrictionsSchemaRestrictionRestrictionValue.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AndroidEnterprise.V1.Model.AppRestrictionsSchemaRestrictionRestrictionValue do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
